Fix: bs:disable-line 1001 not suppressing cannotFindFunction (1140) errors#1708
Fix: bs:disable-line 1001 not suppressing cannotFindFunction (1140) errors#1708Copilot wants to merge 2 commits into
Conversation
|
@copilot so then, can you iterate on this a bit more? try changing the file sizing, etc. We do this in language server mode a lot, which is where we encountered it. so you could try building the entire system inside language server mode, and iterating by changing file contents until you figure out what is wrong. |
…rors When cannotFindFunction (1140) was split from cannotFindName (1001) in commit #1169, existing 'bs:disable-line 1001' comments silently stopped suppressing undefined-function-call errors. This adds backward-compat logic to util.diagnosticIsSuppressed so that code 1001 also covers 1140, restoring the pre-split behavior. Adds two new test cases: a simple case and the exact 5-level-nested namespace/sub/if scenario from the original bug report. Agent-Logs-Url: https://github.com/rokucommunity/brighterscript/sessions/7dbf34b9-475e-4c3e-ae14-5596edfa8c8b Co-authored-by: TwitchBronBron <2544493+TwitchBronBron@users.noreply.github.com>
Reproduced and fixed in commit 86fc382. Root cause: Commit #1169 ("Move function calls to separate diagnostic") split What I tried: Language server mode ( Fix: A one-line backward-compat check in Added two new tests: a simple case and the exact 5-level namespace/sub/if scenario from the report. |
|
No, this isn't a good fix. I'm just gonna close this. I think it requires a more "human" touch. ;) |
bs:disable-line 1001fails to suppress diagnostics on lines like:Root Cause
Commit #1169 ("Move function calls to separate diagnostic") split
cannotFindFunction(code 1140) fromcannotFindName(code 1001). After that change, calling an undefined function generates code 1140, but users' existing'bs:disable-line 1001comments only suppress code 1001 — so the suppression silently stopped working at every nesting depth.Fix
A backward-compat check was added to
util.diagnosticIsSuppressed: when a disable flag carries code1001(cannotFindName), it now also suppresses diagnostics with code1140(cannotFindFunction), restoring the pre-#1169 behavior without breakingbs:disable-line 1140or any other existing usage.Changes
src/util.ts—diagnosticIsSuppressed: added backward-compat alias so code1001also coverscannotFindFunction(1140).src/files/BrsFile.spec.ts— Two new test cases:'bs:disable-line 1001namespace/function/sub/ifscenario from the bug reportTesting